<?php
namespace app\index\controller;

use think\Controller;

class Index extends Base
{
    public function index()
    {
        // 获取首页大图相关数据
        // 获取广告位相关数据
        $bigPic = model('Featured')->getFeaturedsByType(0);
        $advPic = model('Featured')->getFeaturedsByType(1);
        // 商品分类数据
        $datas = model('Deal')->getNormalDealByCategoeyCityId(1, $this->city->id);
        // 获取四个子分类
        $meishicates = model('Category')->getNormalRecommendCategoryByParentId(1, 4);

        return $this->fetch('', [
            'bigPic' => $bigPic,
            'advPic' => $advPic,
            'datas' => $datas,
            'meishicates' => $meishicates,
        ]);
    }
}
